require(['./config'],()=>{
    require(['template','swiper','header','footer'],(template,Swiper)=>{
        class Index{
            constructor(){
                this. getCategory()
                this.runPicture()
            }
            getCategory(){
                $.get('/libs/json/homeCategory.json',list =>{
                   const html = template('categoryTemplate',{ list })
                    $('#categoryList').html(html)
                })


            }

            runPicture () {
                new Swiper ('.swiper-container', {
                    pagination: '.swiper-pagination',
                    nextButton: '.swiper-button-next',
                    prevButton: '.swiper-button-prev',
                    paginationClickable: true,
                    spaceBetween: 30,
                    centeredSlides: true,
                    autoplay:4000,
                    autoplayDisableOnInteraction: false
                })


            }
            





        }

        new Index()
    })
})

